Skip Headers

Oracle® OLAP Reference 10g Release 2 (10.2) Part Number B14350-01 |
Home | Book List | Contents | Index | Master Index | Feedback

Previous | Next
| View PDF

# OLAP_CONDITION Overview

`OLAP_CONDITION` modifies an analytic workspace within the context of a `SELECT FROM OLAP_TABLE` statement. You can specify `OLAP_CONDITION` like other Oracle functions, typically in the `WHERE` clause.

You can use `OLAP_CONDITION` to set an option, execute a `LIMIT` command, execute an OLAP model or forecast, or run a program. The changes made to the workspace can be transitory or they can persist in your session upon completion of the query.

## Entry Points in the Limit Map

Parameters of `OLAP_CONDITION` identify an invocation of `OLAP_TABLE`, specify an entry point in the limit map, and provide the OLAP DML command to be executed at that entry point.

The target limit map must include a `ROW2CELL` column. `OLAP_CONDITION` uses this column to identify an instance of `OLAP_TABLE`. Within that instance `OLAP_CONDITION` executes the OLAP DML command at one of three possible entry points. The entry point that you specify will determine whether the condition affects the data returned by the query and whether the condition remains in effect upon completion of the query.

`OLAP_CONDITION` can be triggered at any of the following points:

- Before the status of the dimensions in the limit map is saved (which occurs before the result set is calculated).

- After the result set has been calculated and before it is fetched. (Default)

- After the result set has been fetched and the status of the dimensions in the limit map has been restored.

The entry points are described in detail in Table 29-2, "Entry Points for OLAP_CONDITION in the OLAP_TABLE Limit Map".

## Dynamically Modifying a Workspace during a Query

There are several mechanisms for modifying an analytic workspace on the fly during the execution of `OLAP_TABLE`. In addition to `OLAP_CONDITION`, you can use syntax supported by the `OLAP_TABLE` function itself: The `PREDMLCMD` and `POSTDMLCMD` clauses in the limit map, as well as the olap_command parameter. `OLAP_CONDITION` has the advantage of portability, since it is not embedded within `OLAP_TABLE`, and versatility, since it can be applied at different entry points.

`OLAP_TABLE` saves the status of dimensions in the limit map before executing the `LIMIT` commands that generate the result set for the query. After the data is fetched, `OLAP_TABLE` restores the status of the dimensions. You can specify a `PREDMLCMD` clause in the limit map to cause an OLAP DML command to execute before the dimension status is saved. Modifications resulting from the `PREDMLCMD` clause remain in the workspace after execution of `OLAP_TABLE`, unless reversed with a `POSTDMLCMD` clause. For more information, see "Limit Map Parameter".

The olap_command parameter of `OLAP_TABLE` specifies an OLAP DML command that executes immediately before the result set is fetched. In some circumstances, the olap_command parameter may contain an OLAP DML `FETCH` command, which itself manages the fetch. Limits set by the olap_command parameter are only in effect during the execution of `OLAP_TABLE`. For more information, see "OLAP Command Parameter".